/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Model;

import java.awt.Color;
import java.util.ArrayList;

/**
 *
 * @author snowangelic
 */
public class Cluster {
    private String name;
    private Color color;
    private Kmeans kmeans;

    Cluster(Kmeans k,String n, Color c) {
        name=n;
        color=c;
        kmeans=k;
    }

    Cluster(Kmeans k,String n,String c){
        name=n;
        color=StringToColor(c);
        kmeans=k;
    }

    public ArrayList<Weight> getWeightList() {
        return kmeans.getWeightList();
    }

    public DataSet getDataSet(){
        return kmeans.getDataSet();
    }

    private Color StringToColor(String c){
        Color col;
        if(c.equals("Red")) col=new Color(255,0,0);
        else if(c.equals("Green")) col=new Color(0,255,0);
        else if(c.equals("Blue")) col=new Color(0,0,255);
        else if(c.equals("Yellow")) col=new Color(255,255,0);
        else if(c.equals("Cyan")) col=new Color(0,255,255);
        else if(c.equals("Magenta")) col=new Color(255,0,255);
        else if(c.equals("Black")) col=new Color(0,0,0);
        else col=new Color(255,255,255);
        return col;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the color
     */
    public Color getColor() {
        return color;
    }

    /**
     * @param color the color to set
     */
    public void setColor(String c) {
        color=StringToColor(c);
    }

    /**
     * @return the kmeans
     */
    public Kmeans getKmeans() {
        return kmeans;
    }

    /**
     * @param kmeans the kmeans to set
     */
    public void setKmeans(Kmeans kmeans) {
        this.kmeans = kmeans;
    }

}
